﻿
<!DOCTYPE html>
<!--字典编辑-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px" size="mini"
                 label-position="right">
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.category" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{"分组类别"+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.key" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{"Key"+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.value" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{"Value"+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <div class="el-input el-input--mini el-input-group el-input-group--prepend">
                            <div class="el-input-group__prepend">
                                {{"排序"+mark.m}}
                            </div>
                            <div>
                                <el-input-number class="el-input__inner" v-model="Form.serialNumber" :min="1" label="描述文字" size="mini">
                                </el-input-number>
                            </div>

                        </div>
                    </div>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{"描述"+mark.m}}
                                </div>
                                <el-input class="el-textarea__inner" type="textarea" v-model="Form.remarks"
                                          autocomplete="off"></el-input>

                            </div>
                        </el-form-item>
                    </div>
                </el-col>
                <!-- <el-col :span="24">
                    <el-form-item :label="SysDict.Remarks+mark.m" prop="Remarks" class="inputTextarea">
                        <el-input type="textarea" v-model="Form.remarks" autocomplete="off"></el-input>
                    </el-form-item>
                </el-col> -->
            </el-row>


            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSubmit}}</el-button>
                    <!-- <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSubmit}}</el-button> -->
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                //业务表单内容
                Form: {},
                DickList: [],//下拉树
                //表单验证
                rules: {

                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    //console.log("xxxxxx",this.Form);
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            //onSubmitForm(this, '/api/DataDir/Save', mythis.Form);
                            //////////////////////////////////////////////////////
                            var url = '/api/DataDir/Save';
                            //var mythis = this;
                            var Form = mythis.Form;
                           
                            console.log("yyyyyy", mythis);
                            myAjax("post", mythis, url, mythis.Form, function (response) {
                                showMessage(msg.OperatingOk, 'success');
                               
                                mythis.submit = true;
                                
                            }, false, function (response) {
                                showMessage(response.message, 'error')
                            });
                            //////////////////////////////////////////////////////
                        } else {
                            //验证失败
                            return false;
                        }
                    });

                },
                getData: function () {
                    getData(this, '/api/DataDir/get?id=' + this.id);
                },
            },
            mounted: function () {
                //this.id = getUrlParam("id");
                this.id = "E0E40888-2922-4F7F-8003-C3D1E2F4147C";
                this.getData();

            }
        });

    </script>
</body>

</html>